module main;

import std.stdio;
import std.getopt;

immutable VERSION = "0.0.1";

int main(string [] args)
{

	bool bUsage = false;
	string outfile = "";
	string listfile = "";
	string src = "";
	bool bBigEndian = true;
	bool bLittleEndian = false;
	bool bOnlyAssemble = false;

	getopt(args,
	       "EB|big-endian", &bBigEndian,
	       "EL|little-endian", &bLittleEndian,
	       "l|listfile", &listfile,
			"o|outfile", &outfile,
	       "c|assemble-only", &bOnlyAssemble,
	       "src", &src,
	       "h|?|help", &bUsage
	       );

	if (bUsage) {
		usage();
		return 0;
	}

	return 0;
}

void banner()
{
	writeln("sdasm SIDEARM Assembler v", VERSION);
	writeln("Build #", __VERSION__);
	writeln("Copyright 2013 Open Design Strategies, LLC");
	writeln("100% Open Source under OSI-approved CDDL");
	writeln("");
}

void usage()
{
	banner();

	writeln("Usage: sdasm [options]");
	writeln("Where [options] are:");
	writeln("-c, --assemble-only            Only assemble unit. No linking.");
	writeln("-E<endian>");
	writeln("   -EB, --big-endian           Output object file in big endian");
	writeln("   -EL, --little-endian        Output object file in little endian");
	writeln("-l, --listfile <file>          Generate listing to <file>");
	writeln("-o, --outfile <file>           Final executable file");
	writeln("-src <file>                    Assemble <file> source file");
	writeln("-h, -?, --help                 Display this help information");
}